package com.zzc.sale.feigns;


import com.hos.entity.sys.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @author: 陈海彬
 * @date: Created in 2023/12/11 20:00
 * @description:
 * @modified By:
 * @version:
 */
@FeignClient(name = "hos-system")
public interface UserFeign {

    /**
     * 根据用户id和部门id查询用户列表
     */
    @PostMapping("/system/user/getUser")
    List<User> getUser(@RequestBody Map<String, Object> params);


    /**
     * 根据手机号查询所属的用户信息
     *
     * @param phone 手机号
     */
    @GetMapping("/system/user/selectUserByPhone/{phone}")
    User selectUserByPhone(@PathVariable String phone);


    /**
     * 根据用户ID查找用户
     *
     * @param userid 用户ID
     * @return 根据用户ID查询到的用户
     */
    @GetMapping("/system/user/getUserById/{userid}")
    User getUserById(@PathVariable Long userid);


    /**
     * 查询所有可用的用户
     */
    @GetMapping("/system/user/selectAllUser")
    List<User> selectAllUser();
}
